URLRewrite problem (seems it continues rewriting in spite of [L])

It seems very simple, but I'm already about knocking my head against
walls.

I want urls like "http://host/dir/blabla" to be rewritten to
"http://host/dir/script.php?param=blabla"

The following .htaccess is put into /dir/

---- .htaccess ---
RewriteEngine On
RewriteRule ^(.*)$ script.php?param=$1 [L]
-----------------------

The script.php ( in /dir/) gets "param" as "script.php".

If I use something like
RewriteRule ^([^s].*)$ script.php?param=$1 [L]
the engine works as I want.

So, what's up?

Thank you!
RR [ Mi, 06 Dezember 2006 18:04 ] [ ID #1559156 ]

Re: URLRewrite problem (seems it continues rewriting in spite of [L])

"rr" <anatoly.rr [at] gmail.com> schreef in bericht
news:1165424677.534833.121310 [at] 80g2000cwy.googlegroups.com...
> I want urls like "http://host/dir/blabla" to be rewritten to
> "http://host/dir/script.php?param=blabla"
>
> The following .htaccess is put into /dir/
> RewriteEngine On
> RewriteRule ^(.*)$ script.php?param=$1 [L]
>
> The script.php ( in /dir/) gets "param" as "script.php".
>
> If I use something like
> RewriteRule ^([^s].*)$ script.php?param=$1 [L]
> the engine works as I want.
>
> So, what's up?
Your destination after rewrite is in the same folder, either
put it elsewhere or exclude it from the rewrite:
RewriteCond %{SCRIPT_URL} !/script\.php$
RewriteRule (.*) script.php?param=$1 [L]

HansH
HansH [ Mi, 06 Dezember 2006 20:30 ] [ ID #1559160 ]

Re: URLRewrite problem (seems it continues rewriting in spite of [L])

rr wrote:
> It seems very simple, but I'm already about knocking my head against
> walls.
>
> I want urls like "http://host/dir/blabla" to be rewritten to
> "http://host/dir/script.php?param=blabla"

An internal redirect is performed after a URL rewrite, which will
re-execute all of the rules in .htaccess causing infinite recursion. I
like to check if a status variable is set and be done. Also you don't
need the end-of-line anchor since regexps are greedy by default.

RewriteCond %{ENV:REDIRECT_ISDONE} =""
RewriteRule ^(.*) script.php?param=$1 [E=ISDONE:1,L]

--Randall
R Krause [ Do, 07 Dezember 2006 18:16 ] [ ID #1560397 ]
Webserver » alt.apache.configuration » URLRewrite problem (seems it continues rewriting in spite of [L])

Vorheriges Thema: Apache 1.3 vs Apache 2.X and SOAP::Lite
Nächstes Thema: apache 2.0, mod_auth_ldap over SSL failing with can't connect ldap server